/*
 * main.cpp
 *
 *  Created on: Nov 28, 2009
 */

#include "common/utils/StringUtils.h"
#include "image/api/ImageEntity.h"
#include "image/impl/ImageController.h"
#include "filter/impl/HighBoost.h"
#include "filter/impl/Roberts.h"
#include "filter/impl/Sobel.h"
#include "filter/impl/LowPass.h"
#include "filter/impl/Mediana.h"


#include <iostream>
#include <string>

using namespace std;

int main(int argc, char **argv) {
	IImageController *controller = ImageController::getInstance();
	string imagePath = "lena.bmp";

	ImageEntity *image = controller->getImage(imagePath);

	IFilter *highBoost = new HighBoost(1);
	ImageEntity *highImage = highBoost->apply(image);
	controller->saveImage("lena.bmp", "_lenaHighBoost.bmp", highImage);
	delete highBoost;
	delete highImage;

	IFilter *roberts = new Roberts(60);
	ImageEntity *robertsImage = roberts->apply(image);
	controller->saveImage("lena.bmp", "_lenaRoberts.bmp", robertsImage);
	delete robertsImage;
	delete roberts;

	IFilter *sobel = new Sobel(60);
	ImageEntity *sobelImage = sobel->apply(image);
	controller->saveImage("lena.bmp", "_lenaSobel.bmp", sobelImage);
	delete sobelImage;
	delete sobel;

	IFilter *lowPass = new LowPass();
	ImageEntity *lowImage = lowPass->apply(image);
	controller->saveImage("lena.bmp", "_lenaLow.bmp", lowImage);
	delete lowImage;
	delete lowPass;

	IFilter *mediana = new Mediana();
	ImageEntity *medianaImage = mediana->apply(image);
	controller->saveImage("lena.bmp", "_lenaMediana.bmp", medianaImage);
	delete medianaImage;
	delete mediana;

	delete controller;
}
